package exception;

import static org.junit.Assert.*;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

import org.junit.Test;

public class UseBuilderExceptionTest {

    @Test
    public void testNewInstance() {
        //Object exception = new UseBuilderException().message("Test message").cause(new Exception()).newInstance();
        //System.out.println(exception);
        
        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");

        String dateStringBefore = "2011-06-01 22:22:30";
        String dateStringAfter = "2011-06-01 10:10:01";
        
        Date before = null;
        Date after = null;
        try {
            before = formatter.parse(dateStringBefore);
            after = formatter.parse(dateStringAfter);
        } catch (ParseException ex) {
            // do nothing
        }      
        
        Date now = new Date();
        
        boolean mustBeTrue = before.before(now);
        
        System.out.println(before);
        System.out.println(now);
        
        assertTrue(mustBeTrue);
        
        
        
        
    }

}
